package com.cogent.business.helper;

import java.util.HashMap;
import java.util.List;

import com.cogent.dynamicform.util.DynamicFormBusUtil;
import com.cogent.validator.facade.ValidatorFacade;
import com.cogent.validator.facade.impl.ValidatorFacadeImpl;

public class ValidatorHelper {
	public static String getScript(String formName) {
		ValidatorFacade validatorFacade = new ValidatorFacadeImpl();		
		return validatorFacade.getScript(formName);
	}
	
	public static String getScript(String formName, List subList) {
		ValidatorFacade validatorFacade = new ValidatorFacadeImpl();		
		return validatorFacade.getScript(formName, DynamicFormBusUtil.getValidatorList(subList));
	}
	
	public static String validator(String formName, HashMap formdata) {
		ValidatorFacade validatorFacade = new ValidatorFacadeImpl();		
		return validatorFacade.validator(formName, formdata);
	}
	
	public static String validator(List validatorList, HashMap dataMap) {
		ValidatorFacade validatorFacade = new ValidatorFacadeImpl();	
		return validatorFacade.validator(validatorList, dataMap);
	}
}
